<template>
  <div>
      <div class="item-card" v-for="(item, index) in containList" :key="index">
        <van-button
          :size="item.size"
          :plain="index!=checked"
          :text="item.name"
          block
          :type="item.type||'info'"
          :color="item.color"
          @click="back(item.path,index)"
        ></van-button>
        <div :class="index==checked?'remark':''" v-if="index==checked">{{item.remark}}</div>
      </div>
  </div>
</template>
<script>
export default {
    props: ['containList'],
  data() {
    return {
        checked:-1,
    };
  },
  methods: {
    back(url,index){
        if(!url){
            this.checked = index
            return
        }
        if(url === '-1'){
            window.history.go(-1)
        }else{
            this.$router.push({
                path:url
            })
        }
    },
},
  mounted() {

  },
};
</script>
<style lang="less" scoped>
.item-card {
  margin: 40px 40px 0 40px;
}
.checked{
    border: 1 solid red;
}
.remark{
    margin: 20px 0;
    padding: 20px;
    text-align: left;
    border: 1px solid #1989fa;
}
</style>